import 'package:flutter/material.dart';

class IntegralRulesView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        title: Text('积分规则'),
      ),
      body: ListView(
        padding: EdgeInsets.all(20),
        children: [
          desc(),
          header('阅读新闻'),
          body('每日有效阅读一篇新闻，可获得1分，上限为3分。'),
          header('阅读公告'),
          body('阅读未读公告可获得1分。'),
          header('登录'),
          body('每日首次登录获得1积分，每日上限为1分。'),
        ],
      ),
    );
  }

  Widget desc() {
    return Text(
      '    “矿校云”考试学习平台将对以下操作进行积分，规则如下：',
      style: TextStyle(
        fontSize: 16,
        color: Colors.black,
      ),
    );
  }

  Widget header(text) {
    return Padding(
      padding: EdgeInsets.only(top: 20),
      child: Text(
        text,
        style: TextStyle(
          fontSize: 14,
          color: Colors.black,
          fontWeight: FontWeight.bold,
        ),
      ),
    );
  }

  Widget body(text) {
    return Padding(
      padding: EdgeInsets.only(top: 3),
      child: Text(
        text,
        style: TextStyle(
          fontSize: 14,
          color: Colors.black,
        ),
      ),
    );
  }
}
